<template>
<view>
		<view class="example">
			<uni-forms ref="valiForm">
				<uni-forms-item label="姓名" userName="userName">
					<uni-easyinput v-model="formData.userName" placeholder="请输入姓名" disabled />
				</uni-forms-item>
				<uni-forms-item label="工号" userName="userId">
					<uni-easyinput v-model="formData.userId" placeholder="请输入工号" disabled/>
				</uni-forms-item>
				<uni-forms-item label="申请人电话" userName="userPhone">
					<uni-easyinput v-model="formData.userPhone" placeholder="请输入电话"  disabled/>
				</uni-forms-item>
				
				<uni-forms-item label="车牌号" userName="autoPlateNum">
					<uni-easyinput v-model="formData.autoPlateNum" placeholder="请输入车牌号"  disabled/>
				</uni-forms-item>
				<uni-forms-item label="维修类型" userName="autoRepairType">
					<uni-easyinput v-model="formData.autoRepairType" placeholder="请输入维修类型"  disabled/>
				</uni-forms-item>
				<uni-forms-item label="故障描述" userName="repairDescribe">
					<uni-easyinput type="textarea" v-model="formData.repairDescribe" placeholder="请输入故障描述"  disabled/>
				</uni-forms-item>
				<uni-forms-item label="维修厂" userName="repairFactory">
					<uni-easyinput v-model="formData.repairFactory" placeholder="请输入维修厂"  disabled/>
				</uni-forms-item>
				<uni-forms-item label="送修日期" userName="repairStartTime">
					<uni-datetime-picker type="datetime" return-type="string" v-model="formData.repairStartTime"  disabled/>
				</uni-forms-item>
				<uni-forms-item label="期望取车日期" userName="repairEndTime">
					<uni-datetime-picker type="datetime" return-type="string" v-model="formData.repairEndTime"  disabled/>
				</uni-forms-item>
				<uni-forms-item label="目前状态">
					<uni-easyinput v-model="formData.repairOrderStatus" placeholder="请输入当前状态" disabled />
				</uni-forms-item>
			</uni-forms>
			<!-- 移除按钮 -->
		</view>
	</view>
</template>

<script>
	import RepairDetailedInfo from "../../components/repairDetailedInfo/repairDetailedInfo.vue"
	export default {
		data() {
			return {
				formData: {
					userName: "",
					userId: "",
					userPhone: "",
					autoPlateNum: "",
					autoRepairType: "",
					repairDescribe: "",
					repairFactory: "",
					repairStartTime: "",
					repairEndTime: "",
					repairOrderStatus:""
				},
				orderId:"",
			}
		},
		methods: {
			getRepairApplicationDetail(){
				console.log("test");
				uni.request({
					url:"http://localhost:8088/getRepairOrderDetail?repairOrderId="+this.orderId,
					method:"GET",
					success:(res)=> {
						if(res.data.code === "0"){
							console.log(res.data.data);
							this.formData = res.data.data;
						}
						
					}
				})
			}
		},
		created() {
			const orderId = this.$route.query.orderId || ""; // 如果没有 orderId 参数，默认设置为空字符串
			this.orderId = orderId;
			console.log(this.orderId);
			// this.getAutoApplicationDetail();
			this.getRepairApplicationDetail()
		}
	}
</script>

<style lang="scss">
.example {
	padding: 15px;
	background-color: #fff;
}

.segmented-control {
	margin-bottom: 15px;
}

.button-group {
	margin-top: 15px;
	display: flex;
	justify-content: space-around;
}

.form-item {
	display: flex;
	align-items: center;
}

.button {
	display: flex;
	align-items: center;
	height: 35px;
	margin-left: 10px;
}
</style>



